import 'package:chop/widgets/TextSizeWidget.dart';
import 'package:flutter/material.dart';

LoginOut(BuildContext context,
    {String text, VoidCallback click, VoidCallback callback}) {
  showModalBottomSheet(
      context: context,
      backgroundColor: Color.fromRGBO(0, 0, 0, 0),
      builder: (builder) {
        return GestureDetector(
          onTap: callback,
          child: Container(
              height: 150.0,
              color: Color.fromRGBO(0, 0, 0, 0),
              child: Column(
                children: <Widget>[
                  Container(
                    width: MediaQuery.of(context).size.width * 0.8,
                    child: RaisedButton(
                        child: FixedSizeText(text),
                        color: Color.fromRGBO(255, 255, 255, 0.99),
                        padding: EdgeInsets.only(top: 10, bottom: 10),
                        textColor: Colors.redAccent,
                        shape: RoundedRectangleBorder(
                          borderRadius: BorderRadius.circular(10),
                        ),
                        onPressed: click),
                  ),
                  Container(
                    height: 10,
                  ),
                  Container(
                    width: MediaQuery.of(context).size.width * 0.8,
                    child: RaisedButton(
                      child: FixedSizeText("取消"),
                      color: Color.fromRGBO(255, 255, 255, 0.99),
                      padding: EdgeInsets.only(top: 10, bottom: 10),
                      textColor: Colors.black26,
                      shape: RoundedRectangleBorder(
                        borderRadius: BorderRadius.circular(10),
                      ),
                      onPressed: callback,
                    ),
                  )
                ],
              )),
        );
      });
}

// ignore: missing_return
Widget ShowBottom(BuildContext context,
    {String text,String backText, VoidCallback click, VoidCallback callback}) {
  showModalBottomSheet(
      context: context,
      backgroundColor: Color.fromRGBO(0, 0, 0, 0),
      builder: (builder) {
        return GestureDetector(
          onTap: callback,
          child: Container(
              height: 150.0,
              color: Color.fromRGBO(0, 0, 0, 0),
              child: Column(
                children: <Widget>[
                  Container(
                    width: MediaQuery.of(context).size.width * 0.8,
                    child: RaisedButton(
                        child: FixedSizeText(text),
                        color: Color.fromRGBO(255, 255, 255, 0.99),
                        padding: EdgeInsets.only(top: 10, bottom: 10),
//                        textColor: Colors.black26,
                        shape: RoundedRectangleBorder(
                          borderRadius: BorderRadius.circular(10),
                        ),
                        onPressed: click),
                  ),
                  Container(
                    height: 10,
                  ),
                  Container(
                    width: MediaQuery.of(context).size.width * 0.8,
                    child: RaisedButton(
                      child: FixedSizeText("$backText"),
                      color: Color.fromRGBO(255, 255, 255, 0.99),
                      padding: EdgeInsets.only(top: 10, bottom: 10),
//                      textColor: Colors.black26,
                      shape: RoundedRectangleBorder(
                        borderRadius: BorderRadius.circular(10),
                      ),
                      onPressed: callback,
                    ),
                  )
                ],
              )),
        );
      });
}